﻿using gt.dotnetcore.webapi.extension.Entity;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;

namespace gt.dotnetcore.webapi.extension.Results
{
    public class SuccessResult<T> : IActionResult
    {
        T _data;
        public SuccessResult(T data)
        {
            _data = data;
        }
        public async Task ExecuteResultAsync(ActionContext context)
        {
            var result = new ApiResponse<T>(_data);
            var or = new ObjectResult(result);
            await or.ExecuteResultAsync(context);
        }
    }
}
